https://t.me/RX1948
Server : LiteSpeed
System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User : idnco5810 ( 1093)
PHP Version : 8.2.29
Disable Function : NONE
Directory :  /usr/local/CyberPanel/lib/python3.10/site-packages/validators/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/CyberPanel/lib/python3.10/site-packages/validators/__pycache__/length.cpython-310.pyc
o

���g��
@s^dZddlmZddlmZddlmZeddd�ded	eedfd
eedffdd��ZdS)
zLength.�)�Union�)�between)�	validatorN��min_val�max_val�valuerrcCsF|dur|dkrtd��|dur|dkrtd��ttt|�||d��S)a�Return whether or not the length of given string is within a specified range.

    Examples:
        >>> length('something', min_val=2)
        # Output: True
        >>> length('something', min_val=9, max_val=9)
        # Output: True
        >>> length('something', max_val=5)
        # Output: ValidationError(func=length, ...)

    Args:
        value:
            The string to validate.
        min_val:
            The minimum required length of the string. If not provided,
            minimum length will not be checked.
        max_val:
            The maximum length of the string. If not provided,
            maximum length will not be checked.

    Returns:
        (Literal[True]): If `len(value)` is in between the given conditions.
        (ValidationError): If `len(value)` is not in between the given conditions.

    Raises:
        (ValueError): If either `min_val` or `max_val` is negative.
    Nrz7Length cannot be negative. `min_val` is less than zero.z7Length cannot be negative. `max_val` is less than zero.r)�
ValueError�boolr�len)r	rr�r
�G/usr/local/CyberPanel/lib/python3.10/site-packages/validators/length.py�lengths
r)	�__doc__�typingrr�utilsr�str�intrr
r
r
r�<module>s4

https://t.me/RX1948 - 2025